package com.vivo.module.criteria;

import com.vivo.module.criteria.config.CriteriaMeta;
import com.vivo.module.criteria.config.OrderMeta;
import com.vivo.module.criteria.config.PagerMeta;
import com.vivo.module.criteria.config.CriteriaMeta.User;

public class TestService {

	public void getTest(Criteria criteria) {
		System.out.println(criteria.toString());
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TestService testService = new TestService();
		// TODO BUG
		Criteria<User> criteria = Criteria.newInstance(CriteriaMeta.user);
		criteria.add(CriteriaMeta.User.email.addValue("email"));
		criteria.add(CriteriaMeta.User.userId.addValue(1));
		criteria.add(CriteriaMeta.User2.userId.addValue(2));
		
		criteria.add(CriteriaMeta.Basic.ApplicationId.addValue(3));
		criteria.add(PagerMeta.startpos.addValue(4));
		criteria.add(PagerMeta.offset.addValue(5));
		
		criteria.add(OrderMeta.order.addValue(OrderMeta.asc));
		testService.getTest(criteria);

		testService.getTest(Criteria.newInstance(CriteriaMeta.basic).add(
		        CriteriaMeta.Basic.ApplicationId.addValue(4)));

		// BasicMeta basicMeta = CriteriaMeta.basicMeta;
		// BasicMeta basicMet2 = CriteriaMeta.basicMeta2;
		// BasicMeta applicationName = CriteriaMeta.basicMeta.ApplicationName;
		// BasicMeta applicationNam2 = CriteriaMeta.basicMeta2.ApplicationName;
		// CriteriaMeta.basicMeta.ApplicationName.addValue("ss");
		// CriteriaMeta.basicMeta2.ApplicationName.addValue("ss");

	}
}
